* ---------------------------------------------------------------------- * Stefanos Moschidis - SAP Certified Technical Consultant * ---------------------------------------------------------------------- FUNCTION ZPM_ACT_TYP_SUBT. *"---------------------------------------------------------------------- *"*"Local interface: *" TABLES *" SHLP_TAB TYPE SHLP_DESCR_TAB_T *" RECORD_TAB STRUCTURE SEAHLPRES *" CHANGING *" VALUE(SHLP) TYPE SHLP_DESCR_T *" VALUE(CALLCONTROL) LIKE DDSHF4CTRL STRUCTURE DDSHF4CTRL *"---------------------------------------------------------------------- * EXIT immediately, if you do not want to handle this step IF CALLCONTROL-STEP <> 'SELONE' AND CALLCONTROL-STEP <> 'SELECT' AND " AND SO ON CALLCONTROL-STEP <> 'DISP'. EXIT. ENDIF. *"---------------------------------------------------------------------- * STEP SELONE (Select one of the elementary searchhelps) *"---------------------------------------------------------------------- * This step is only called for collective searchhelps. It may be used * to reduce the amount of elementary searchhelps given in SHLP_TAB. * The compound searchhelp is given in SHLP. * If you do not change CALLCONTROL-STEP, the next step is the * dialog, to select one of the elementary searchhelps. * If you want to skip this dialog, you have to return the selected * elementary searchhelp in SHLP and to change CALLCONTROL-STEP to * either to 'PRESEL' or to 'SELECT'. IF CALLCONTROL-STEP = 'SELONE'. EXIT. ENDIF. *"---------------------------------------------------------------------- * STEP PRESEL (Enter selection conditions) *"---------------------------------------------------------------------- * This step allows you, to influence the selection conditions either * before they are displayed or in order to skip the dialog completely. * If you want to skip the dialog, you should change CALLCONTROL-STEP * to 'SELECT'. * Normaly only SHLP-SELOPT should be changed in this step. IF CALLCONTROL-STEP = 'PRESEL'. * PERFORM PRESEL .......... EXIT. ENDIF. *"---------------------------------------------------------------------- * STEP SELECT (Select values) *"---------------------------------------------------------------------- * This step may be used to overtake the data selection completely. * To skip the standard seletion, you should return 'DISP' as following * step in CALLCONTROL-STEP. * Normally RECORD_TAB should be filled after this step IF CALLCONTROL-STEP = 'SELECT'. * PERFORM STEP_SELECT TABLES RECORD_TAB USING SHLP CHANGING RC. * IF RC = 0. * CALLCONTROL-STEP = 'DISP'. * ELSE. * CALLCONTROL-STEP = 'EXIT'. * ENDIF. EXIT. "Don't process STEP DISP additionally in this call. ENDIF. *"---------------------------------------------------------------------- * STEP DISP (Display values) *"---------------------------------------------------------------------- * This step is called, before the selected data is displayed. * You can e.g. modify or reduce the data in RECORD_TAB * according to the users authority. * If you want to get the standard display dialog afterwards, you * should not change CALLCONTROL-STEP. * If you want to overtake the dialog on you own, you must return * the following values in CALLCONTROL-STEP: * - "RETURN" if one line was selected. The selected line must be * the only record left in RECORD_TAB. The corresponding fields of * this line are entered into the screen. * - "EXIT" if the values request should be aborted * - "PRESEL" if you want to return to the selection dialog IF CALLCONTROL-STEP = 'DISP'. * PERFORM AUTHORITY_CHECK TABLES RECORD_TAB USING SHLP. data : begin of myval occurs 0 , kokrs like ZPM_ACT_TYP_SUBT-kokrs , LSTAR like ZPM_ACT_TYP_SUBT-LSTAR , ZZACT_SUBTYPE like ZPM_ACT_TYP_SUBT-ZZACT_SUBTYPE , DATBI like ZPM_ACT_TYP_SUBT-DATBI . data : end of myval . data : mlstar like csla-lstar . data : myrecord like SEAHLPRES . tables : CATSD . data : DYNAME LIKE D020S-PROG , DYNUMB LIKE D020S-DNUM . DYNAME = 'SAPLCATS' . DYNUMB = sy-dynnr . data : DYNPFIELDS type standard table of DYNPREAD with header line . data : POVSTEPL LIKE SY-STEPL . CALL FUNCTION 'DYNP_GET_STEPL' IMPORTING POVSTEPL = POVSTEPL EXCEPTIONS STEPL_NOT_FOUND = 1 OTHERS = 2. IF SY-SUBRC <> 0. clear POVSTEPL . ENDIF. clear : DYNPFIELDS , DYNPFIELDS[] . DYNPFIELDS-FIELDNAME = 'CATSD-LSTAR' . DYNPFIELDS-STEPL = POVSTEPL . append DYNPFIELDS . CALL FUNCTION 'DYNP_VALUES_READ' EXPORTING DYNAME = DYNAME DYNUMB = DYNUMB * TRANSLATE_TO_UPPER = ' ' * REQUEST = ' ' * PERFORM_CONVERSION_EXITS = ' ' * PERFORM_INPUT_CONVERSION = ' ' DETERMINE_LOOP_INDEX = 'X' TABLES DYNPFIELDS = DYNPFIELDS EXCEPTIONS INVALID_ABAPWORKAREA = 1 INVALID_DYNPROFIELD = 2 INVALID_DYNPRONAME = 3 INVALID_DYNPRONUMMER = 4 INVALID_REQUEST = 5 NO_FIELDDESCRIPTION = 6 INVALID_PARAMETER = 7 UNDEFIND_ERROR = 8 DOUBLE_CONVERSION = 9 STEPL_NOT_FOUND = 10 OTHERS = 11 . IF SY-SUBRC eq 0. read table DYNPFIELDS index 1 . mlstar = DYNPFIELDS-fieldvalue . select * from ZPM_ACT_TYP_SUBT into corresponding fields of table myval where KOKRS = '1000' and LSTAR = mlstar and DATBI = '99991231' . loop at myval . move myval to myrecord-string . append myrecord to record_tab . endloop . ENDIF. EXIT. ENDIF. ENDFUNCTION.